package com.ssy.lingxi.order.model.bo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * 采购流程中的支付环节配置
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-30
 */
public class PayNodeBO implements Serializable {
    private static final long serialVersionUID = 4985375041141327529L;

    public PayNodeBO() {
    }

    public PayNodeBO(Integer serialNo, Integer batchNo, String payNode, BigDecimal payRate) {
        this.serialNo = serialNo == null ? 0 : serialNo;
        this.batchNo = batchNo == null ? 0 : batchNo;
        this.payNode = payNode == null ? "" : payNode;
        this.payRate = payRate == null ? BigDecimal.ZERO : payRate;
    }

    /**
     * 支付批次
     */
    private Integer serialNo;

    /**
     * 支付次数
     */
    private Integer batchNo;

    /**
     * 支付环节
     */
    private String payNode;

    /**
     * 支付比例
     */
    private BigDecimal payRate;

    public Integer getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(Integer serialNo) {
        this.serialNo = serialNo;
    }

    public Integer getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(Integer batchNo) {
        this.batchNo = batchNo;
    }

    public String getPayNode() {
        return payNode;
    }

    public void setPayNode(String payNode) {
        this.payNode = payNode;
    }

    public BigDecimal getPayRate() {
        return payRate;
    }

    public void setPayRate(BigDecimal payRate) {
        this.payRate = payRate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) return false;
        PayNodeBO payNodeBO = (PayNodeBO) o;
        return batchNo.equals(payNodeBO.batchNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(batchNo);
    }
}
